<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui">

<h:head>My Sales Card</h:head>
<body>
	<ui:composition template="/Template/TemplateContractor.xhtml">
		<ui:define name="EmployeeContent">
			<p:dataTable id="CardTable" var="card" value="#{listOfTimeCards.listTimeCards}">
				<f:facet name="header">
					<h:outputText value="List of Time Cards" />
				</f:facet>
				<p:column headerText="Data">
					<h:outputText value="#{card.date}" >
						<f:convertDateTime pattern="dd-MM-yyyy" timeZone="CET"/>
					</h:outputText>
				</p:column>
				<p:column headerText="Start Time">
					<h:outputText value="#{card.start}" >
						<f:convertDateTime pattern="HH:mm" timeZone="CET"/>
					</h:outputText>
				</p:column>
				<p:column headerText="End Time">
					<h:outputText value="#{card.end}" >
						<f:convertDateTime pattern="HH:mm" timeZone="CET"/>
					</h:outputText>
				</p:column>
				<p:column>
					<f:facet name="header">
						<h:form>
							<p:commandButton value="Delete"
								action="#{listOfTimeCards.DeleteTimeCards()}"
								update=":CardTable" ajax="true"></p:commandButton>
						</h:form>
					</f:facet>
					<p:selectBooleanCheckbox>
						<p:ajax listener="#{listOfTimeCards.AddListDeletedTimeCard(card)}" />
					</p:selectBooleanCheckbox>
				</p:column>
			</p:dataTable>
		</ui:define>
	</ui:composition>
</body>
</html>
